.class Lcom/instagram/creation/video/f/aw;
.super Ljava/lang/Object;
.source "VideoScrubberFragmentBase.java"

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final synthetic a:Lcom/instagram/creation/video/f/as;


# direct methods
.method constructor <init>(Lcom/instagram/creation/video/f/as;)V
    .locals 0
    .parameter

    .prologue
    .line 314
    iput-object p1, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 5

    .prologue
    const/16 v4, 0x280

    .line 317
    iget-object v0, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    iget-object v0, v0, Lcom/instagram/creation/video/f/as;->a:Lcom/instagram/creation/video/f/ap;

    invoke-static {v0}, Lcom/instagram/creation/video/f/ap;->g(Lcom/instagram/creation/video/f/ap;)Lcom/instagram/creation/video/widget/PreviewTextureView;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/creation/video/widget/PreviewTextureView;->getBitmap()Landroid/graphics/Bitmap;

    move-result-object v0

    .line 318
    const-string v1, "VideoScrubberFragmentBase"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Original width: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " height; "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 319
    const/4 v1, 0x1

    invoke-static {v0, v4, v4, v1}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v1

    .line 323
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->recycle()V

    .line 325
    new-instance v0, Ljava/io/File;

    iget-object v2, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    iget-object v2, v2, Lcom/instagram/creation/video/f/as;->a:Lcom/instagram/creation/video/f/ap;

    iget-object v2, v2, Lcom/instagram/creation/video/f/ap;->a:Lcom/instagram/pendingmedia/model/a;

    invoke-virtual {v2}, Lcom/instagram/pendingmedia/model/a;->b()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v2}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v0

    .line 326
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/4 v3, 0x0

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v4

    add-int/lit8 v4, v4, -0x4

    invoke-virtual {v0, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, ".jpeg"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 329
    :try_start_0
    invoke-static {}, Lcom/instagram/creation/video/j/k;->a()Z

    move-result v2

    if-nez v2, :cond_0

    .line 330
    iget-object v2, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    iget-object v2, v2, Lcom/instagram/creation/video/f/as;->a:Lcom/instagram/creation/video/f/ap;

    invoke-virtual {v2}, Lcom/instagram/creation/video/f/ap;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2}, Lcom/instagram/creation/video/j/k;->e(Landroid/content/Context;)V

    .line 332
    :cond_0
    new-instance v2, Ljava/io/File;

    iget-object v3, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    iget-object v3, v3, Lcom/instagram/creation/video/f/as;->a:Lcom/instagram/creation/video/f/ap;

    invoke-virtual {v3}, Lcom/instagram/creation/video/f/ap;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-static {v3}, Lcom/instagram/creation/video/j/k;->c(Landroid/content/Context;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3, v0}, Ljava/io/File;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 333
    new-instance v0, Ljava/io/FileOutputStream;

    invoke-direct {v0, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V

    .line 334
    sget-object v3, Landroid/graphics/Bitmap$CompressFormat;->JPEG:Landroid/graphics/Bitmap$CompressFormat;

    const/16 v4, 0x5f

    invoke-virtual {v1, v3, v4, v0}, Landroid/graphics/Bitmap;->compress(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z

    .line 336
    invoke-virtual {v0}, Ljava/io/FileOutputStream;->close()V

    .line 337
    iget-object v0, p0, Lcom/instagram/creation/video/f/aw;->a:Lcom/instagram/creation/video/f/as;

    iget-object v0, v0, Lcom/instagram/creation/video/f/as;->a:Lcom/instagram/creation/video/f/ap;

    invoke-virtual {v0}, Lcom/instagram/creation/video/f/ap;->Z()Lcom/instagram/pendingmedia/model/c;

    move-result-object v0

    invoke-virtual {v2}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/instagram/pendingmedia/model/c;->e(Ljava/lang/String;)V

    .line 338
    const-string v0, "VideoScrubberFragmentBase"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "Cover photo path "

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v2}, Ljava/io/File;->getCanonicalPath()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/facebook/e/a/a;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 342
    return-void

    .line 339
    :catch_0
    move-exception v0

    .line 340
    new-instance v1, Ljava/lang/RuntimeException;

    invoke-direct {v1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V

    throw v1
.end method
